package com.atguigu.upp.mapper;

import com.atguigu.upp.bean.TaskTagRule;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Smexy on 2022/11/11
 */
public interface TaskTagRuleMapper
{
    //如果计算的标签有四级标签的，那么需要把四级标签和sql计算的结果的映射规则也查询出来
    @Select("    SELECT" +
                "    t1.*, tag_name subTagValue" +
                " FROM" +
                " (SELECT * FROM `task_tag_rule` WHERE task_id = #{id} ) t1" +
                " JOIN " +
                " ( SELECT id,`tag_name` FROM tag_info ) t2" +
                " ON t1.`sub_tag_id`=t2.id")
    List<TaskTagRule> getTaskTagRulesByTaskId(String taskId);
}
